package com.zhupanlin.zhyl.task.scheduled;

import com.zhupanlin.common.rabbit.MQConst;
import com.zhupanlin.common.rabbit.service.RabbitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/12/8 22:59
 */
@Component
@EnableScheduling
public class ScheduleTask {

    @Autowired
    private RabbitService rabbitService;

    // 每天8点执行方法，就医提醒
    // cron 表达式，设置执行时间间隔
    @Scheduled(cron = "0 0 8 * * ?")
    public void taskPatient() {
        rabbitService.sendMessage(MQConst.EXCHANGE_DIRECT_TASK, MQConst.ROUTING_TASK_8, "");
    }
}
